package com.byzx.wine.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.byzx.wine.dao.WinefactoryMapper;
import com.byzx.wine.jdbcdao.FactoryDao;
import com.byzx.wine.po.Winefactory;
import com.byzx.wine.service.IFactoryService;
import com.byzx.wine.util.Page;
@Service
public class FactoryServiceimpl implements IFactoryService{
	@Autowired
	private FactoryDao fd;//dao
	@Autowired
	private WinefactoryMapper wfm;   //jdbc  Dao 
	
	// 分页查询（调用dao层）
	public Page<Map<String, Object>> findPage(Page<Map<String, Object>> page) {
			return fd.findPage("com.byzx.wine.jdbcdao.factoryDao.findall2", page);
		}

		// 添加角色
			public int insert(Winefactory winefactory) {
				return wfm.insert(winefactory);
			}

			@Override
			public Winefactory selectByPrimaryKey(Integer id) {
				// TODO Auto-generated method stub
				return wfm.selectByPrimaryKey(id);
			}

			@Override
			public int updateByPrimaryKeySelective(Winefactory factory) {
				// TODO Auto-generated method stub
				return wfm.updateByPrimaryKeySelective(factory);
			}

			@Override
			public int updateByPrimaryKey(Winefactory factory) {
				// TODO Auto-generated method stub
				return wfm.updateByPrimaryKey(factory);
			}

			@Override
			public int deleteByPrimaryKey(Integer id) {
				// TODO Auto-generated method stub
				return wfm.deleteByPrimaryKey(id);
			}

}
